/*
 * Copyright (c) Huawei Technologies Co., Ltd. 2024-2024. All rights reserved.
 * Description: 集合通信remote notify实现
 */

#ifndef REMOTE_NOTIFY_IMPL_H
#define REMOTE_NOTIFY_IMPL_H

#include "notify_base.h"

namespace hccl {
class RemoteNotifyImpl {
public:
    RemoteNotifyImpl();
    ~RemoteNotifyImpl();

    HcclResult Init(const std::vector<u8>& byteVector);
    HcclResult Init(const HcclSignalInfo &notifyInfo,
                    const NotifyLoadType type = NotifyLoadType::DEVICE_NOTIFY);

    HcclResult Open();
    HcclResult Close();
    HcclResult Post(Stream& stream, HcclDispatcher dispatcher, s32 stage);
    HcclResult GetNotifyData(HcclSignalInfo &notifyInfo);
    HcclResult SetNotifyData(HcclSignalInfo &notifyInfo);
    inline HcclRtNotify ptr()
    {
        return notify_->ptr();
    }
    // 获取offset
    HcclResult GetNotifyOffset(u64 &notifyOffset);
private:
    std::unique_ptr<NotifyBase> notify_;
};
}

#endif // REMOTE_NOTIFY_IMPL_H
